m = int(input())
if m < 0:
    m = abs(m)
sum_of_digits = sum(int(digit) for digit in str(m))
print(sum_of_digits)

